<?php
include 'dbInclude.php';
$cname = $_POST["company_name"];
$desc = $_POST["description"];
$sector = $_POST["slct2"];

echo $cname;
echo $desc;
echo $sector;
/*$rows = $db->query("SELECT SECTOR_ID FROM sector_master WHERE NAME='".$sector."'");
$id =  mysql_fetch_array ($rows);
$id1= $id['SECTOR_ID'];*/
//$rows=$db->query("UPDATE sector_master SET SECTOR_ID='000110' WHERE SECTOR_ID='".$id1."';");
echo "INSERT INTO instrument_master(INSTR_ID, INSTR_NAME, DESCRIPTION, SECTOR_ID) VALUES ('000000001','".$cname."','".$desc."','".$sector."');";
$rows=$dbh->query("INSERT INTO instrument_master(INSTR_NAME, DESCRIPTION, SECTOR_ID) VALUES ('".$cname."','".$desc."','".$sector."');");
echo "INSERT INTO instrument_master(INSTR_ID, INSTR_NAME, DESCRIPTION, SECTOR_ID) VALUES ('000000001','".$cname."','".$desc."','".$sector."');";
$rows12=$dbh->query("select * from instrument_master ORDER by INSTR_ID DESC ;");
$instid="";
foreach($rows12 as $row)
{
	$instid= $row["INSTR_ID"];
	break;
}
$rows=$dbh->query("INSERT INTO market(INSTR_ID) VALUES ('".$instid."');");
header("Location: {$_SERVER['HTTP_REFERER']}");
    exit;
?>